package com.mz.ozy.activity.login;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.mz.ozy.R;
import com.mz.ozy.base.BaseActivity;
import com.mz.ozy.bean.MeBean;
import com.mz.ozy.mvp.presenter.AccountSetPresenter;
import com.mz.ozy.mvp.view.AccountSetContract;
import com.mz.ozy.utils.ToastUtils;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 设置昵称
 */
public class SetNickActivity extends BaseActivity<AccountSetContract.View, AccountSetPresenter> implements AccountSetContract.View {

    @BindView(R.id.etNick)
    EditText mEtNick;
    @BindView(R.id.bt_next)
    Button mBtNext;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_set_nick);
        ButterKnife.bind(this);
        initTitle();
//        lineView.setVisibility(View.GONE);
    }

    @OnClick(R.id.bt_next)
    public void onViewClicked() {
        String nick = mEtNick.getText().toString().trim();
        if (TextUtils.isEmpty(nick)) {
            ToastUtils.showToast("昵称不能为空!");
            return;
        }
        mPresenter.onUpdate(this, AccountSetPresenter.TYPE_NICKNAME,nick);
    }

    @Override
    public void onMeSuccess(MeBean bean) {

    }

    @Override
    public void onUpdateSuccess(int type) {
//        startActivity(new Intent(this,SportsSurveyActivity.class));
    }

    @Override
    public void onLogoutSuccess() {

    }

    @Override
    public void onCancelBindSuccess() {

    }

    @Override
    public void onGetAlipayAuthSuccess(String sdkUrl) {

    }

    @Override
    public void onAuthBindSuccess() {

    }

}
